﻿using FreeSql.DatabaseModel;using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using Newtonsoft.Json;
using FreeSql.DataAnnotations;

namespace Unis.FMS.Platform.Order.Domain {

	[JsonObject(MemberSerialization.OptIn), Table(Name = "doc_dpt_task_appointment", DisableSyncStructure = true)]
	public partial class DocDptTaskAppointment {

		[JsonProperty, Column(Name = "id", DbType = "bigint", IsPrimary = true, IsIdentity = true)]
		public long Id { get; set; }

		/// <summary>
		/// 实际创建时间,客户端操作实际发生时间,UTC
		/// </summary>
		[JsonProperty, Column(Name = "actual_create_time", DbType = "datetime")]
		public DateTime ActualCreateTime { get; set; } = DateTime.Parse("1970-01-01 00:00:00");

		/// <summary>
		/// 实际更新时间,客户端操作实际发生时间,UTC
		/// </summary>
		[JsonProperty, Column(Name = "actual_update_time", DbType = "datetime")]
		public DateTime ActualUpdateTime { get; set; } = DateTime.Parse("1970-01-01 00:00:00");

		[JsonProperty, Column(Name = "appointment_date", DbType = "datetime")]
		public DateTime AppointmentDate { get; set; } = DateTime.Parse("1970-01-01 00:00:00");

		/// <summary>
		/// 预约单号
		/// </summary>
		[JsonProperty, Column(Name = "appointment_no", StringLength = 50, IsNullable = false)]
		public string AppointmentNo { get; set; }

		/// <summary>
		/// 预约类型 0发货人预约 1收货人预约 2 WO
		/// </summary>
		[JsonProperty, Column(Name = "appointment_type", DbType = "tinyint")]
		public sbyte AppointmentType { get; set; } = 0;

		/// <summary>
		/// cancel或reschedule时填的note
		/// </summary>
		[JsonProperty, Column(Name = "cancel_note", StringLength = 500, IsNullable = false)]
		public string CancelNote { get; set; }

		[JsonProperty, Column(Name = "cancel_reason", StringLength = 100, IsNullable = false)]
		public string CancelReason { get; set; }

		/// <summary>
		/// contractor or carrier
		/// </summary>
		[JsonProperty, Column(Name = "contractor_or_carrier", IsNullable = false)]
		public string ContractorOrCarrier { get; set; }

		/// <summary>
		/// 创建人
		/// </summary>
		[JsonProperty, Column(Name = "create_user", StringLength = 50, IsNullable = false)]
		public string CreateUser { get; set; }

		/// <summary>
		/// 创建人
		/// </summary>
		[JsonProperty, Column(Name = "created_by", DbType = "int")]
		public int CreatedBy { get; set; } = 0;

		/// <summary>
		/// 创建时间
		/// </summary>
		[JsonProperty, Column(Name = "created_time", DbType = "datetime", InsertValueSql = "CURRENT_TIMESTAMP")]
		public DateTime CreatedTime { get; set; }

		/// <summary>
		/// 客户是否确认
		/// </summary>
		[JsonProperty, Column(Name = "customer_confirmed", DbType = "tinyint")]
		public sbyte CustomerConfirmed { get; set; }

		/// <summary>
		/// 报酬
		/// </summary>
		[JsonProperty, Column(Name = "earning")]
		public decimal Earning { get; set; } = 0.00M;

		/// <summary>
		/// 是否删除（0.正常 1.删除）;0.正常 1.删除
		/// </summary>
		[JsonProperty, Column(Name = "is_del", DbType = "tinyint")]
		public sbyte IsDel { get; set; } = 0;

		/// <summary>
		/// 是否发布open job
		/// </summary>
		[JsonProperty, Column(Name = "is_open_job", DbType = "tinyint")]
		public sbyte IsOpenJob { get; set; } = 0;

		[JsonProperty, Column(Name = "note", StringLength = 500, IsNullable = false)]
		public string Note { get; set; }

		/// <summary>
		/// 服务商是否确认 0 否 1是 2拒绝 3 Cancel after accepted
		/// </summary>
		[JsonProperty, Column(Name = "service_confirmed", DbType = "tinyint")]
		public sbyte ServiceConfirmed { get; set; }

		[JsonProperty, Column(Name = "shipment_order_key", DbType = "bigint")]
		public long ShipmentOrderKey { get; set; }

		[JsonProperty, Column(Name = "shipment_order_no", StringLength = 50, IsNullable = false)]
		public string ShipmentOrderNo { get; set; }

		/// <summary>
		/// 0 未约成 1已约成 2预约失败 3预约取消/违约
		/// </summary>
		[JsonProperty, Column(Name = "status", DbType = "tinyint")]
		public sbyte Status { get; set; }

		[JsonProperty, Column(Name = "task_no", DbType = "bigint")]
		public long TaskNo { get; set; } = 0;

		/// <summary>
		/// 第三方的预约单号，只展示
		/// </summary>
		[JsonProperty, Column(Name = "third_appointment_no", StringLength = 50, IsNullable = false)]
		public string ThirdAppointmentNo { get; set; }

		/// <summary>
		/// 预约开始时间
		/// </summary>
		[JsonProperty, Column(Name = "time_from", DbType = "datetime", InsertValueSql = "CURRENT_TIMESTAMP")]
		public DateTime TimeFrom { get; set; }

		/// <summary>
		/// 预约结束时间
		/// </summary>
		[JsonProperty, Column(Name = "time_to", DbType = "datetime", InsertValueSql = "CURRENT_TIMESTAMP")]
		public DateTime TimeTo { get; set; }

		[JsonProperty, Column(Name = "tracking_no", StringLength = 50, IsNullable = false)]
		public string TrackingNo { get; set; }

		/// <summary>
		/// 更新人
		/// </summary>
		[JsonProperty, Column(Name = "update_by", DbType = "int")]
		public int UpdateBy { get; set; } = 0;

		/// <summary>
		/// 更新时间
		/// </summary>
		[JsonProperty, Column(Name = "update_time", DbType = "datetime", InsertValueSql = "CURRENT_TIMESTAMP")]
		public DateTime UpdateTime { get; set; }

		/// <summary>
		/// 修改人
		/// </summary>
		[JsonProperty, Column(Name = "update_user", StringLength = 50, IsNullable = false)]
		public string UpdateUser { get; set; }

		[JsonProperty, Column(Name = "work_order_key", DbType = "bigint")]
		public long WorkOrderKey { get; set; } = 0;

		[JsonProperty, Column(Name = "work_order_no", StringLength = 50, IsNullable = false)]
		public string WorkOrderNo { get; set; }

	}

}
